package com.example.parking.controller;

import com.example.parking.dto.LoginFrom;
import com.example.parking.dto.Result;
import com.example.parking.service.ILoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@CrossOrigin//跨域
public class LoginController {

    @Resource
    private ILoginService loginService;

    /**
     * 用户登录(新用户注册)操作
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestBody LoginFrom loginFrom){
        return loginService.login(loginFrom);
    }

}
